#!/bin/bash
##菜单选择
installs(){
	echo -e "[1]install services\n[2]unstall services\n[3]System&&Service config"
	read iu
	if [[ "$iu" == '1' ]];then
		echo -e "[1]installer k8s&&docker\n[2]installer docker\n[3]installer k8s"
		read install_s
		bash k8s_install/install/Y "${install_s}" "${PI}"
	elif [[ "$iu" == '2' ]];then
		echo -e "[1]unstall all\n[2]unstall k8s\n[3]unstall docker"
		read unstall_s
		bash k8s_install/unstall/Y "${unstall_s}" "${PI}"
	elif [[ "$iu" -eq "3" ]];then
		echo -e "[1]config source/yum\n[2]config sysctl\n[3]config docker\n[4]Config K8S"
		read config_s
		bash k8s_install/config/Y "$config_s"
	else
		echo "select errors"
		bash $0
	fi
}
if [ -f "/usr/bin/yum" ];then
	export PI='1'
	PI='1'
	echo "use yum"
	echo -e '#!/bin/bash
PI=1' > THEISPI
fi
if [ -f "/usr/bin/apt-get" ];then
	export PI='2'
	PI='2'
	echo "use apt"
	echo -e '#!/bin/bash
PI=2' > THEISPI
fi
installs
